package com.blackbird.jang.model;

import com.blackbird.jang.MainActivity;
import com.wiyun.engine.nodes.Node;
import com.wiyun.engine.nodes.Sprite;
import com.wiyun.engine.utils.TargetSelector;

/**
 * 炸弹
 * 
 * @author jang
 *
 */
public class ExplodingButton extends ToolButton {


	public ExplodingButton(Node normalSprite, Node selectedSprite,
			Node disabledSprite, Node focusedSprite, TargetSelector selector) {
		super(normalSprite, selectedSprite, disabledSprite, focusedSprite, selector);
		
		this.setPosition(280 * MainActivity.SCALE_X,
				750 * MainActivity.SCALE_Y);
	}
	
	public static ExplodingButton make(int normalResId, int selectedResId,
			int disabledResId, int focusedResId, Node target, String selector) {

		return new ExplodingButton(
				Sprite.make(normalResId),
				selectedResId != 0 ? ((Node) (Sprite.make(selectedResId)))
						: null,
				disabledResId != 0 ? ((Node) (Sprite.make(disabledResId)))
						: null,
				focusedResId != 0 ? ((Node) (Sprite.make(focusedResId))) : null,
				new TargetSelector(target, selector, null));
	}
	
	
	/**
	 * 爆炸使一个棋子消失
	 */
	public void onAction() {
		
//		GameLayer.isExploding = !GameLayer.isExploding;
//		
//		if(GameLayer.isExploding){
//			GameLayer.isInterchanging = false;
//			GameLayer.isColorchanging = false;
//			
//			sparkle();
//		}else{
//			reset();
//		}
//		explodingButton.setScale(f);
		
//		if (selectedBlock != null) {
//			selectedBlock.reset();
//			
//			map.removeBlock(selectedBlock);
//			selectedBlock = null;
//		}
	}


}
